Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace getMongoData.js legacy mongo shell script with mongoWellnessChecker.js script for new mongosh shell #134

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

hasaketa
Copy link

This PR introduces a new script which replicates the functionality of the existing getMongoData.js legacy mongo shell script. The new script provides the same functionality and output but is written using a modern mongosh shell program.

Changes introduced:

  1. Addition of new script 'mongoWellnessChecker.js' that performs the same functionality as 'getMongoData.js'
  2. Updated README file for the new 'mongoWellnessChecker.js' script.
  3. Sample Output from the new script.
  4. 'getMongoData.js' is preserved for history and backward compatibility.

To verify the correctness of the new script, we have run a series of tests that cover all functions of the legacy script.

The rationale for creating a duplicate instead of refactoring the original script is to ensure a smooth transition and avoid potential service disruptions.

@hasaketa
Copy link
Author

@devkev @ntang

Could you please review this PR when you get a moment? If everything looks good, could you please approve and merge it?

Best,
Nishant Bhardwaj

@hasaketa hasaketa marked this pull request as draft April 24, 2024 07:48
…age with no other diagnostic information.

FixSummary: replaced "throw(..)"  with "throw new Error(..)". This change helps the outermost try catch block
to function correctly because it needs the e.message property to exist.
@hasaketa
Copy link
Author

added two more fixes to the script so it aborts gracefully with more diagnostic information in cases where the database user executing the script does not have full permissions.

@hasaketa hasaketa marked this pull request as ready for review April 24, 2024 10:23
@hasaketa
Copy link
Author

hasaketa commented Apr 24, 2024

For now we are going to keep getMongoData.js in addition to this script to support legacy mongo shell

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants